package com.morningstar.system.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.morningstar.common.arco.ISelectOption;
import com.morningstar.common.dao.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;

/**
 * 表单设计器配置表
 */
@Getter
@Setter
@TableName(value ="sys_form", autoResultMap = true)
public class SysForm extends BaseEntity implements ISelectOption {

    @TableId(value = "form_id", type = IdType.ASSIGN_ID)
    private Long formId;

    @TableField("form_name")
    private String formName;

    @TableField(value = "form_config", typeHandler = JacksonTypeHandler.class)
    private Object formConfig;

    @TableField(value = "form_list", typeHandler = JacksonTypeHandler.class)
    private Object formList;

    @TableField(value = "form_item", typeHandler = JacksonTypeHandler.class)
    private Object formItem;

    @TableField(value = "form_model", typeHandler = JacksonTypeHandler.class)
    private Object formModel;

    @TableField(value = "form_permission", typeHandler = JacksonTypeHandler.class)
    private Object formPermission;

    @TableField("remark")
    private String remark;

    @TableField("status")
    private String status;

    @Override
    public String getLabel() {
        return formName;
    }

    @Override
    public Long getValue() {
        return formId;
    }
}
